package tools;

import java.io.File;
import java.io.PrintWriter;
import java.util.List;
import java.util.stream.Collectors;

import cn.hutool.core.io.FileUtil;

public class DistinctDict {
	public static void main(String[] args) {
		List<String> lines = FileUtil.readLines("F:/zongyicd/key.txt","GBK");
		System.out.println(lines.size());
		List<String> newsLines = lines.stream().distinct().collect(Collectors.toList());
		File file = new File("F:/zongyicd/test.dic");
		PrintWriter wirter = FileUtil.getPrintWriter(file, "UTF-8", true); 
		for (String bk : newsLines) {  
			//System.out.println(bk);
			wirter.append(bk);
			wirter.append("\n"); 
		}
		wirter.close();
		System.out.println(newsLines.size());
	}
}
